/*
 * node 爬取网站图片等
 */
const express = require('express')
const route = express.Router()
const path = require('path')
const fs = require('fs')

const crawl = require('./crawl')

route.get('/', (req, res) => {
    let htmlPath = path.join(__dirname, 'index.html')
    res.send(fs.readFileSync(htmlPath, 'utf-8'))
})

route.get('/meizhuo', crawl)

module.exports = {
    path: '/crawl',
    route
}